package com.itmeima.controller;

import com.itmeima.bean.Subway;
import com.itmeima.service.SubwayService;
import com.itmeima.service.impl.SubwayServiceImpl;

import java.util.ArrayList;

public class SubwayController {
    private SubwayService subwayService = new SubwayServiceImpl();
    //查看
    public void viewSubways() {
        ArrayList<Subway> subList = subwayService.viewSubways();
        if (subList.isEmpty()){
            System.out.println("当前没有地铁站信息，请先添加。");
            return;
        }
        for (Subway subway : subList) {
            System.out.println(subway);
        }

    }

    //判断
    public boolean judge(String subID,String subName) {
        return subwayService.judge(subID,subName);
    }

    //添加
    public boolean addSubways(Subway sub) {
        return subwayService.addSubways(sub);
    }
}
